package com.ls.config;

import java.time.LocalDate;

import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.ls.util.DataFormatter;

/**
 * 2.0 之前还是extens WebMvcConfigurationAdapter,
 *     之后是实现WebMvcConfigurer  接口
 * @author lisai
 *
 */

@Configuration
public class WebConfig implements WebMvcConfigurer {

	@Override
	public void addFormatters(FormatterRegistry registry) {
		registry.addFormatterForFieldType(LocalDate.class, new DataFormatter());
		/*WebMvcConfigurer.super.addFormatters(registry);*/
	}
}
